package com.cros.files;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class ArrayByteToFile {
	
public static void main(String argv[]) throws IOException{
	byte[] arrayData = new byte[5];
	
	String name="C:\newFile.txt";
    File f = new File(name);
    f.createNewFile();
  
    FileInputStream fileInputStream = new FileInputStream(name);
    ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(arrayData);
    OutputStream outputStream = new FileOutputStream(name);
    int data;
    while ((data = byteArrayInputStream.read()) != -1) {
    outputStream.write(data);
    }

    fileInputStream.close();
    outputStream.close();
    
}


}
